import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'


// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 8081,
    hmr: true,
    open: true,
    // 前端解决跨域
    // proxy: {
    //   // 以 /api打头的接口
    //   '/api':{
    //     target: 'http://localhost:8089/', //后端接口地址
    //     changeOrigin: true,
    //     rewrite: (path) => path.replace(/^\/api/, ''), //重写以/api开头的接口
    //   }
    // }
  },
  resolve: {
    alias: [{
      find: '@',
      replacement: resolve(__dirname, 'src'),
    }]
  }
})
